import { defineStore } from 'pinia'

// 第一个参数是应用程序中 store 的唯一 id
export const useMainStore = defineStore('main', {
    state: () => {
        return {
            counter: 0,
            name: "HuStoking",
            isAdmin: true
        };
    },
    getters: {
        getAddCounter: (state) => {
            return (num:number) => state.counter + num;
        },
        getAddCounter2():number  {
            return this.counter * 2.5;
        },

    }
})
